{% extends "profiles/base.html" %}
{% comment %}
<!--
  Copyright (C) 2010 ZHENG Zhong <http://www.zhengzhong.net/>
  Created on 2010-02-19.
  $Id$
-->
{% endcomment %}


{#________________________________________________________________________________________________#}

{% block html_title %} Edit profile of {{ user|escape }} {% endblock %}

{#________________________________________________________________________________________________#}

{% block content %}

  {% if profile_form %}

    <div class="section">
      <h1>
        {% if not profile %}
          Create your profile ....
        {% else %}
          Edit your basic information ...
        {% endif %}
      </h1>
    </div>

    <div class="section">

      <form id="profile-form" class="xl-form" action="." method="POST">

        <div class="field">
          <div class="label">Your email address:</div>
          <div class="disabled-value">{{ user.email|escape }}</div>
        </div>

        <div class="field">
          <div class="label">Your name: *</div>
          <div class="input required">{{ profile_form.name|safe }}</div>
          {% if profile_form.name.errors %}
            <div class="error-list">{{ profile_form.name.errors|safe }}</div>
          {% endif %}
        </div>

        <div class="field">
          <div class="label">Alternative Email address:</div>
          <div class="input">{{ profile_form.alt_email|safe }}</div>
          {% if profile_form.alt_email.errors %}
            <div class="error-list">{{ profile_form.alt_email.errors|safe }}</div>
          {% endif %}
        </div>

        <div class="field">
          <div class="label">Your phone number:</div>
          <div class="input">{{ profile_form.tel|safe }}</div>
          {% if profile_form.tel.errors %}
            <div class="error-list">{{ profile_form.tel.errors|safe }}</div>
          {% endif %}
        </div>

        <div class="field">
          <div class="label">Write something about yourself:</div>
          <div class="input">{{ profile_form.biography|safe }}</div>
          {% if profile_form.biography.errors %}
            <div class="error-list">{{ profile_form.biography.errors|safe }}</div>
          {% endif %}
        </div>

        <div class="field">
          <div class="label">Your personal website:</div>
          <div class="input">{{ profile_form.website|safe }}</div>
          {% if profile_form.website.errors %}
            <div class="error-list">{{ profile_form.website.errors|safe }}</div>
          {% endif %}
        </div>

        <div class="field">
          <input class="button" type="submit" value="Submit"/>
          &nbsp; or,
          <a href="{% url friday.view_profile username=user_.username %}">return to your profile</a>
        </div>

      </form><!--/#profile-form-->

    </div>

  {% endif %}

{% endblock %}
